/*
 * $Id: Box.java 100 2009-04-30 12:45:50Z meyer@alphatec.de $
 * 
 *
 * Copyright 2009 DeltaDesk
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package deltadesk.gui.deltagui.widget.box;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.Rectangle;

/**
 * DefaultBoxStyle.
 * 
 * @author Andreas Meyer
 * @version $Revision: 100 $
 */
public class DefaultBoxStyle implements BoxStyle {

	/** The gradient light color. */
	private static Color COLOR_LIGHT = new Color(0xACB9C8);
	
	/** The gradient dark color. */
	private static Color COLOR_DARK = new Color(0x93A1B1);

	
	/**
	 * @see deltadesk.gui.deltagui.graphics.Renderable#render(java.awt.Graphics2D)
	 */
	public void render(final Graphics2D g2) {

		final Rectangle rect = g2.getClipBounds();
		
		g2.setPaint(
				new GradientPaint(0, 1,               COLOR_LIGHT, 
						          0, rect.height - 2, COLOR_DARK));
		g2.fillRoundRect(1, 1, rect.width - 2, rect.height - 2, 6, 6);
	}

}
